From a5b0f465c5c06bdb878b868d3480500a5d0db031 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 30 Nov 2005 12:16:35 +0100 Subject: [PATCH] We need to do sync when mov_to_cr3 to a value already shadowed. The L2 page and already shadowed L1 page may be out of sync. This fixes the problems of segmentation faults and strange prints when booting Redhat FC3 and make kernel in FC3 in VMX domain. Signed-off-by: Xiaofeng Ling --- xen/arch/x86/shadow.c | 3 ++- xen/arch/x86/shadow32.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c index 8819071b04..0663d16f6d 100644 --- a/xen/arch/x86/shadow.c +++ b/xen/arch/x86/shadow.c @@ -2154,7 +2154,8 @@ static void shadow_update_pagetables(struct vcpu *v) #elif CONFIG_PAGING_LEVELS == 4 smfn = shadow_l4_table(d, gpfn, gmfn); #endif - } + }else + shadow_sync_all(d); if ( !get_shadow_ref(smfn) ) BUG(); old_smfn = pagetable_get_pfn(v->arch.shadow_table); diff --git a/xen/arch/x86/shadow32.c b/xen/arch/x86/shadow32.c index c4162186f1..9d372ac4de 100644 --- a/xen/arch/x86/shadow32.c +++ b/xen/arch/x86/shadow32.c @@ -2911,6 +2911,8 @@ void __update_pagetables(struct vcpu *v) */ if ( unlikely(!(smfn = __shadow_status(d, gpfn, PGT_base_page_table))) ) smfn = shadow_l2_table(d, gpfn, gmfn); + else + shadow_sync_all(d); if ( !get_shadow_ref(smfn) ) BUG(); old_smfn = pagetable_get_pfn(v->arch.shadow_table); -- 2.30.2